// See https://sequelize.org/master/manual/model-basics.html
// for more of what you can do here.
const Sequelize = require('sequelize');
const DataTypes = Sequelize.DataTypes;

module.exports = function (app) {
  const sequelizeClient = app.get('sequelizeClient');
  const shopShoplist = sequelizeClient.define('shop_shoplist', {
    shopname: { //店铺名称
      type: DataTypes.STRING,
      allowNull: true
    },
    logo: { //商户logo
      type: DataTypes.STRING,
    },
    Defaultshop: { //默认店铺
      type: DataTypes.STRING,
    },
    AffiliatedMerchant: { //所属商户
      type: DataTypes.STRING,
      allowNull: true
    },
    contacts: { //联系人
      type: DataTypes.STRING,
      allowNull: true
    },
    phonenumber: { //手机号
      type: DataTypes.STRING,
      allowNull: true
    },
    address: { //地址
      type: DataTypes.STRING,
    },
    time: { //营业时间
      type: DataTypes.STRING,
    },
    latitude: { //店铺纬度
      type: DataTypes.STRING,
    },
    longitude: { //店铺经度
      type: DataTypes.STRING,
    },
    BusinessLicense: { //营业执照
      type: DataTypes.STRING,
    },
    CreditCode: { //统一社会信用码
      type: DataTypes.STRING,
    },
    BankName: { //银行名称
      type: DataTypes.STRING,
    },
    BankAccountName: { //银行卡账户名
      type: DataTypes.STRING,
    },
    BankNumber: { //银行卡卡号
      type: DataTypes.STRING,
    },
    remark: { //备注信息
      type: DataTypes.STRING,
    },
    state: { //状态
      type: DataTypes.STRING,
    },
  }, {
    hooks: {
      beforeCount(options) {
        options.raw = true;
      }
    }
  });

  // eslint-disable-next-line no-unused-vars
  shopShoplist.associate = function (models) {
    // Define associations here
    // See https://sequelize.org/master/manual/assocs.html
  };

  return shopShoplist;
};